/**
 * related to recordrow.ui
 * 
 * @Author : lily80239464
 * @Timestamp : 2017-11-16
 */
var do_App = sm("do_App");
var do_Page = sm("do_Page");
var do_DataCache = sm("do_DataCache");
var do_Label_name = ui("do_Label_name");
var do_Label_address = ui("do_Label_address");
var do_Label_hot = ui("do_Label_hot");
var do_Label_sfbm = ui("do_Label_sfbm");
var do_Label_time = ui("do_Label_time");
var do_Label_reason = ui("do_Label_reason");
var do_Label_type = ui("do_Label_type");
var do_Label_note = ui("do_Label_note");
var do_Label_holdonPerson = ui("do_Label_holdonperson");
var do_Label_dealResult = ui("do_Label_dealResult");
//声明UI变量
var root=ui("$");  //$表示当前视图的根UI
//设置数据绑定的映射关系
root.setMapping({
	"do_Label_name.text":"Man_name",
	"do_Label_name.tag":"rscchnl",
	"do_Label_address.text":"All_name",
	"do_Label_hot.text":"Hrz_name",
	"do_Label_sfbm.text":"sfbm",
	"do_Label_time.text":"calldt",
	"do_Label_time.tag":"callLong",
	"do_Label_reason.text":"ComforName",
	"do_Label_type.text":"NeiRong",
	"do_Label_note.text":"Remarks",
	"do_Label_holdonPerson.text":"User_name",
	"do_Label_dealResult.text":"IfCL"
	
});
//订阅每次绑定数据后的事件
root.on("dataRefreshed", function(data, e) {
	if (data.Man_name!=null&&data.rscchnl!=null) {
		do_Label_name.text = data.Man_name+" "+data.rscchnl;
	}else if (data.Man_name!=null&&data.rscchnl==null) {
		do_Label_name.text = "姓名："+data.Man_name;
	}else if (data.Man_name==null&&data.rscchnl!=null) {
		do_Label_name.text="来电号码："+data.rscchnl;
	}else {
		do_Label_name.text = "";
	}
	if (data.calldt!=null&&data.callLong!=null) {
		do_Label_time.text = data.calldt+" 共计"+data.callLong;
	}else {
		do_Label_time.text="";
	}
	if (data.ComforName!=null) {
		do_Label_reason.text = "来电原因："+data.ComforName;
		
	}else {
		do_Label_reason.text="来电原因：";
	}
	if (data.ComforName!=null&&data.NeiRong!=null) {
		if (do_Label_reason.text=="故障报修") {
			do_Label_type.text = "故障类型："+data.NeiRong;
		}else {
			do_Label_type.text = "投诉建议："+data.NeiRong;
		}
		
	}else {
		do_Label_type.text="";
	}
	if (data.Remarks!=null) {
		deviceone.print("text:"+do_Label_note.text);
		do_Label_note.text = "来电备注："+data.Remarks;
	}else {
		do_Label_note.text="来电备注：";
	}
	if (data.User_name!=null) {
		do_Label_holdonPerson.text = "接听人："+data.User_name;
	}else {
		do_Label_holdonPerson.text="";
	}
	if (data.sfbm!=null) {
		do_Label_sfbm.text="收费编码："+data.sfbm;
	}else {
		do_Label_sfbm.text="收费编码：";
	}if (data.Hrz_name!=null) {
		do_Label_hot.text="换热站："+data.Hrz_name;
	}else {
		do_Label_hot.text="换热站：";
	}
	if (data.All_name!=null) {
		do_Label_address.text = "地址："+data.All_name;
	}else {
		do_Label_address.text="地址：";
	}
	if (data.IfCL!=null) {
		do_Label_dealResult.fontColor = "81D553FF";
		do_Label_dealResult.text = "处理结果："+data.IfCL;
	}
});